﻿@{
    ViewBag.Title = "电子会员卡二维码";
}

<link href="~/Scripts/miniui/themes/default/medium-mode.css" rel="stylesheet" type="text/css" />       
<script src="@Url.Content("~/Scripts/shared/share.js?v=")@ViewBag.version" type="text/javascript"></script> 
<script src="@Url.Content("~/Scripts/shared/shown.js?v=")@ViewBag.version" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/common/Print.js?v=")@ViewBag.version" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/zxx.drag.1.0.js")" type="text/javascript"></script>

<style type="text/css">
    body {
        overflow:auto !important;
    }
			.main {
				width: 100%;
				height: 120%;
				display: flex;
				flex-wrap: wrap;
				/*justify-content: space-around;*/
			}
			.box-min {
				width: 350px;
				height: auto;
				margin: 20px;
				/*border: 2px solid #000;*/
			}
			.box {
				width: 350px;
				height: 480px;
				border-radius: 10px;
				/*background: url(../QRCode/ShopQRCode.png) no-repeat;*/
				background-size: 100% 100%;
				box-shadow: 0 0 1px 2px #000;
				position: relative;
			}
	
			.box-min h4 {
				text-align: center;
				color: #000;
				margin: 0;
				padding: 15px 0;
                font-family:宋体;
                font-size:11pt;
			}
			
			.box img {
				display: block;
				/*background: #fff;*/
				border-radius: 10px;
				position: absolute;
				/*top: 80px;
				left: 60px;
				width: 223px;
				height: 240px;*/
			}
			
			.box .ramadhin {
				display: block;
				text-align: center;
				color: #000;
				font-size: 26px;
			}

            .box img {
        		width: 350px;
				height: 480px;
            }
		</style>

<div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;"> 
        <table width = "1000px;">
            <tr>
                <td width = "1000px;">
                    <a class="mini-button" id="getdata" name="new" iconCls="icon-search" onclick="LoadData" plain="true">刷新</a>
                    <span class="separator"></span>                    
                    <a class="mini-button" id="close" iconCls="icon-close" onclick="CloseWindowBill" plain="true">关闭</a>
                </td>
            </tr>
        </table>
    </div>

        <input id="combo1" class="mini-combobox" style="width:200px;margin-left:30px;margin-top:10px;" textField="text" valueField="id"
            data="QCodeType" value="3"  allowInput="false"  showNullItem="false" onvaluechanged="TypeChange"/>  

		<div class="main">
            @{
                System.Collections.ArrayList list = (@ViewBag.mData as System.Collections.ArrayList);
                if (list != null)
                {
                    foreach (System.Collections.Hashtable dr in list)
                    {
                        <div class="box-min">
			                <div class="box">
				                <img class="" id="" src="@dr["FileUrl"].ToString()" />
			                </div>
				            <h4>@dr["FStockName"].ToString()</h4>
                        </div>	
                    }
                }
            }
		</div>

<script>
    var QCodeType = [{ "id": "3", "text": "次卡套餐二维码" }];

    mini.parse();
    LoadData();
    function LoadData() {
        //mini.mask({
        //    el: document.body,
        //    cls: 'mini-mask-loading',
        //    html: '二维码加载中, 请稍等......'
        //});

        var type = mini.get("combo1").getValue();
        $.post("getQRcodes", { AppID: parent.window.getSystemAppID(), Type: type }, function (data) {
            var Data = mini.decode(data);
            var html = '';
            for (var i = 0; i < Data.length; i++) {
                html = html + '<div class="box-min"><div class="box"><img class="" id="" src="' + Data[i].FileUrl + '?' + Math.random() + '"'
                    + ' /></div><h4>' + Data[i].FStockName + '</h4></div>';
            }
            $(".main").empty();
            $(".main").append(html);
            //mini.unmask(document.body);
        });
    }
</script>